﻿// code05030100.cpp : 条件语句
// if语句

#include <iostream>
#include <vector>
#include <string>
using namespace std;

int main()
{
	//如果grade小于60分，对应的字面是F，否则计算其下标
	const vector<string> scores = { "F","D","C","B","A","A++" };
	string lettergrade;
	int grade;
	if (grade < 60)
	{
		lettergrade = scores[0];
	}
	else
	{
		lettergrade = scores[grade / 10 - 5];
		//若合格成绩的末尾是8或9，添加+
		//若合格成绩的末尾是0,1或2，添加-
		if (grade % 10 > 7)
		{
			lettergrade += '+';
		}
		else if (grade % 10 < 3)
		{
			lettergrade += '-';
		}
	}
	return 0;
}

